<?php
namespace app\admin\controller;
use think\Controller;
use catetree\Catetree;

Class Test extends Controller
{

	public function index(){
		// $data=db('tp_cate')->select();
		// // dump($data);
  // //       exit;

  //       $data=$this->catetree($data);
  //       dump($data);
  //       exit;

dump( __DIR__ ."/../public/static/uploads/");


}











	public function catetree($cateRes){
    return $this->sort($cateRes);
}
    

    public function sort($cateRes,$pid=0,$level=0){

        static $arr=array();
        foreach ($cateRes as $k => $v) {
            if($v['pid']==$pid){
                $v['level']=$level;
                $arr[]=$v;
                $this->sort($cateRes,$v['id'],$level+1);
            }
        }

        return $arr;
    }
}
